//
//  ViewController.swift
//  YSM
//
//  Created by ys on 2018/7/13.
//  Copyright © 2018年 ys. All rights reserved.
//
import UIKit

struct YSRouter {
    
    static func loadVC<T: BaseViewController>(vcName:String) -> T {
        
        let spaceName = Bundle.main.infoDictionary!["CFBundleExecutable"] as? String
        let clsName = spaceName! + "." + vcName
        
        let cls = NSClassFromString(clsName) as? BaseViewController.Type
        let vc = cls?.init()
        guard let thisVC = vc else {
            return ErrorViewViewController() as! T
        }
        
        return thisVC as! T

    }
}

